<template>
  <div id="app">
    <img src="./assets/logo.png">
    <Login></Login>
    <hr>
    <button @click="increment">增加</button>
    <button @click="decrement">减小</button>
    <button @click="incrementAsync">增加</button>
    <p>当前数字:{{count}}</p>
    <p>{{isEventOrOdd}}</p>
  </div>
</template>

<script>
  import {mapGetters, mapActions,mapState} from 'vuex'

  export default {
    name: 'app',
    data() {
      return {}
    },
    // computed: {
    //   count() {
    //     return this.$store.state.count;
    //   }
    // }
    computed: mapGetters([
      'count',
      'isEventOrOdd'
    ]),
    // computed:mapState([
    //   'count'
    // ]),
    methods:mapActions([
      'increment',
      'decrement',
      'incrementAsync'
    ])
    // methods: {
    //   increment() {
    //     this.$store.commit('increment');
    //   },
    //   decrement() {
    //     this.$store.commit('decrement');
    //   }
    // }
  }
</script>

<style lang="scss">
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin-top: 60px;
  }
</style>
